Optimal. Leaf size=244 \[ -\frac{a^3 (7-4 n) \sin (e+f x) (d \cos (e+f x))^n \text{Hypergeometric2F1}\left (\frac{1}{2},\frac{n}{2},\frac{n+2}{2},\cos ^2(e+f x)\right )}{f (2-n) n \sqrt{\sin ^2(e+f x)}}-\frac{a^3 (1-4 n) \sin (e+f x) \cos (e+f x) (d \cos (e+f x))^n \text{Hypergeometric2F1}\left (\frac{1}{2},\frac{n+1}{2},\frac{n+3}{2},\cos ^2(e+f x)\right )}{f (1-n) (n+1) \sqrt{\sin ^2(e+f x)}}+\frac{a^3 (5-2 n) \tan (e+f x) (d \cos (e+f x))^n}{f (1-n) (2-n)}+\frac{\tan (e+f x) \left (a^3 \sec (e+f x)+a^3\right ) (d \cos (e+f x))^n}{f (2-n)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.399734, antiderivative size = 244, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 6, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.261, Rules used = {4264, 3814, 3997, 3787, 3772, 2643} \[ -\frac{a^3 (7-4 n) \sin (e+f x) (d \cos (e+f x))^n \, _2F_1\left (\frac{1}{2},\frac{n}{2};\frac{n+2}{2};\cos ^2(e+f x)\right )}{f (2-n) n \sqrt{\sin ^2(e+f x)}}-\frac{a^3 (1-4 n) \sin (e+f x) \cos (e+f x) (d \cos (e+f x))^n \, _2F_1\left (\frac{1}{2},\frac{n+1}{2};\frac{n+3}{2};\cos ^2(e+f x)\right )}{f (1-n) (n+1) \sqrt{\sin ^2(e+f x)}}+\frac{a^3 (5-2 n) \tan (e+f x) (d \cos (e+f x))^n}{f (1-n) (2-n)}+\frac{\tan (e+f x) \left (a^3 \sec (e+f x)+a^3\right ) (d \cos (e+f x))^n}{f (2-n)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4264
Rule 3814
Rule 3997
Rule 3787
Rule 3772
Rule 2643
Rubi steps
\begin{align*} \int (d \cos (e+f x))^n (a+a \sec (e+f x))^3 \, dx &=\left ((d \cos (e+f x))^n (d \sec (e+f x))^n\right ) \int (d \sec (e+f x))^{-n} (a+a \sec (e+f x))^3 \, dx\\ &=\frac{(d \cos (e+f x))^n \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{f (2-n)}+\frac{\left (a (d \cos (e+f x))^n (d \sec (e+f x))^n\right ) \int (d \sec (e+f x))^{-n} (a+a \sec (e+f x)) (a (2-2 n)+a (5-2 n) \sec (e+f x)) \, dx}{2-n}\\ &=\frac{a^3 (5-2 n) (d \cos (e+f x))^n \tan (e+f x)}{f (1-n) (2-n)}+\frac{(d \cos (e+f x))^n \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{f (2-n)}+\frac{\left (a (d \cos (e+f x))^n (d \sec (e+f x))^n\right ) \int (d \sec (e+f x))^{-n} \left (a^2 (1-4 n) (2-n)+a^2 (7-4 n) (1-n) \sec (e+f x)\right ) \, dx}{(1-n) (2-n)}\\ &=\frac{a^3 (5-2 n) (d \cos (e+f x))^n \tan (e+f x)}{f (1-n) (2-n)}+\frac{(d \cos (e+f x))^n \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{f (2-n)}+\frac{\left (a^3 (1-4 n) (d \cos (e+f x))^n (d \sec (e+f x))^n\right ) \int (d \sec (e+f x))^{-n} \, dx}{1-n}+\frac{\left (a^3 (7-4 n) (d \cos (e+f x))^n (d \sec (e+f x))^n\right ) \int (d \sec (e+f x))^{1-n} \, dx}{d (2-n)}\\ &=\frac{a^3 (5-2 n) (d \cos (e+f x))^n \tan (e+f x)}{f (1-n) (2-n)}+\frac{(d \cos (e+f x))^n \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{f (2-n)}+\frac{\left (a^3 (1-4 n) \left (\frac{\cos (e+f x)}{d}\right )^{-n} (d \cos (e+f x))^n\right ) \int \left (\frac{\cos (e+f x)}{d}\right )^n \, dx}{1-n}+\frac{\left (a^3 (7-4 n) \left (\frac{\cos (e+f x)}{d}\right )^{-n} (d \cos (e+f x))^n\right ) \int \left (\frac{\cos (e+f x)}{d}\right )^{-1+n} \, dx}{d (2-n)}\\ &=-\frac{a^3 (7-4 n) (d \cos (e+f x))^n \, _2F_1\left (\frac{1}{2},\frac{n}{2};\frac{2+n}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{f (2-n) n \sqrt{\sin ^2(e+f x)}}-\frac{a^3 (1-4 n) \cos (e+f x) (d \cos (e+f x))^n \, _2F_1\left (\frac{1}{2},\frac{1+n}{2};\frac{3+n}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{f (1-n) (1+n) \sqrt{\sin ^2(e+f x)}}+\frac{a^3 (5-2 n) (d \cos (e+f x))^n \tan (e+f x)}{f (1-n) (2-n)}+\frac{(d \cos (e+f x))^n \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{f (2-n)}\\ \end{align*}
Mathematica [F] time = 2.51072, size = 0, normalized size = 0. \[ \int (d \cos (e+f x))^n (a+a \sec (e+f x))^3 \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 2.663, size = 0, normalized size = 0. \begin{align*} \int \left ( d\cos \left ( fx+e \right ) \right ) ^{n} \left ( a+a\sec \left ( fx+e \right ) \right ) ^{3}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (a \sec \left (f x + e\right ) + a\right )}^{3} \left (d \cos \left (f x + e\right )\right )^{n}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (a^{3} \sec \left (f x + e\right )^{3} + 3 \, a^{3} \sec \left (f x + e\right )^{2} + 3 \, a^{3} \sec \left (f x + e\right ) + a^{3}\right )} \left (d \cos \left (f x + e\right )\right )^{n}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (a \sec \left (f x + e\right ) + a\right )}^{3} \left (d \cos \left (f x + e\right )\right )^{n}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]